package com.jr.controller;


import com.jr.entry.PersonalInformation;
import com.jr.service.PersonalinformationService;
import com.jr.util.ResultObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/PersonInfo/")
public class PersonInfoController {

    @Autowired
    private ResultObject resultObject;
    @Autowired
    private PersonalinformationService personalinformationService;
    /*
    * 更新个人中心的信息，100表示成功，101表示失败
    * */
    @RequestMapping("updateInfromation")
    public ResultObject updateInfromation(PersonalInformation personalInformation) {
        System.out.println(personalInformation);
        boolean b = personalinformationService.updatePersonalinformation(personalInformation);
        if (b){
            resultObject.setStatus(100);
//            resultObject.setResult("");
        }else{
            resultObject.setStatus(101);
        }

        return resultObject;
    }
}
